package com.test.kotlin03

import java.lang.IllegalArgumentException

fun main(){
    var number:Int ? = null

    try {
        checkOperation(number)
        number!!.plus(1) //空指针异常
    }catch (e:Exception){
        println("exception:" + e)
    } catch (e:KotlinNullPointerException){
        print("KotlinNullPointerException:" + e)
    }


}


fun checkOperation(number:Int?){
//    number ?: throw UnsKilledException();
    checkNotNull(number,{"Some thing is not good. "})

}
class UnsKilledException():IllegalArgumentException("操作不当")